    //加载百度地图底图
    var map = new BMap.Map('allmap',{minZoom:6,maxZoom:19,enableMapClick:false});
    window.map = map;
    var aroundAccountOverlays;//周边网点覆盖物
    var pointOverlays;
    var heatOverlays;
    var allMapData = [];//地图数据
    var boundaryData = [];//网点边界数据
    var inputData = {};//参数
    var mapDataStatus ;//返回状态
    var searchFlag = false;//地图搜索状态
    var aroundAccountUrl = "/map/aroundAccountMapData";//地图数据接口
    var accountCommunityUrl = "/map/accountCommunityData";
    var accountSearchUrl = "/map/accountSearchData";
    var accountEstateSearchUrl = "/map/accountEstateSearchData";
    var urlParams = window.location.search;
    if(urlParams.indexOf("?")!=-1){
        getUrlParams(urlParams);
    }
    if(urlParams.indexOf("flag=true")!=-1){//是否由其他页面跳转到地图
        var level;
        var city = inputData["city"];
        var district = inputData["district"];
        if(city=="-1"){
            level="1";
        }else if(district!="-1"){
            level="4";
        }else{
            level="3";
        }
        inputData["level"]=level;
        if(level =="1"){//全国
            searchFlag=false;
            map.centerAndZoom(new BMap.Point(106.530635013,29.5446061089),6);
            initMap(aroundAccountUrl,inputData);
        }else if(level =="3"){//市
            $("#city").val(inputData['city']);
            $("#city").change();
            //createAccountDistrict(allMapData);
        }else if(level =="4"){//行政区
            RequestData (accountSearchUrl,inputData);
            scrollFlag = false;
            if(allMapData.length>0){
                map.centerAndZoom(new BMap.Point(allMapData[0].lng, allMapData[0].lat),16);
                createAccount(allMapData);
            }else{
                map.centerAndZoom($("#city").find("option:selected").text(),13);
            }
        }else if(level =="5"){//网点机构
            RequestData (accountCommunityUrl,inputData);
            scrollFlag = false;
            map.centerAndZoom(new BMap.Point(allMapData[0].lng, allMapData[0].lat),19);
            createAccountCommunity(allMapData);
        }
    }else{
        //根据url获取地图类型
        var currentMap = inputData['currentMap'];
        var zoneNumber = $("#city").val();
        map.centerAndZoom(new BMap.Point(106.530635013,29.5446061089),6);
        //渲染地图
        initMap(aroundAccountUrl,{currentMap:currentMap,city:zoneNumber,level:"1"});
    }

    //注册地图层级监听
    map.addEventListener("zoomend",scrollFunc);
    //请求接口
    function RequestData (url,paramsData) {
        $.ajax({
            type: "post",
            url: url,
            data:paramsData,
            async: false,
            success:function (data) {
                allMapData = data.result.mapDataList;
                mapDataStatus = data.result.mapDataStatus;
            }
        })
    }
    //网点边界请求接口
    function boundaryRequestData (url,paramsData) {
        $.ajax({
            type: "post",
            url: url,
            data:paramsData,
            async: false,
            success:function (data) {
                allMapData = data.result.mapDataList;
                mapDataStatus = data.result.mapDataStatus;
                boundaryData = data.result.boundaryList;
            }
        })
    }
    //监听地图层级事件
    function scrollFunc (e) {
        e=e || window.event;
        var zoom = map.getZoom();
        var zoneNumber = $("#city").val();
        var inputData = {currentMap:currentMap,city:zoneNumber};
        if(zoom>=13){
            map.setMinZoom(13);
            map.enableScrollWheelZoom();
        }
        if(zoom>=13 && zoom<16 && scrollFlag){
            map.clearOverlays();
            inputData.level=3;
            RequestData (aroundAccountUrl,inputData);
            createAccountDistrict(allMapData);
        }else if(zoom>=16 && zoom<=19 && scrollFlag){
            map.clearOverlays();
            RequestData (accountSearchUrl,inputData);
            createAccount(allMapData);
        }
    }
    //获取url参数
    function getUrlParams(urlParams){
        var str = urlParams.substr(1);
        var params = str.split("&");
        for(var i = 0; i < params.length; i ++) {
            inputData[params[i].split("=")[0]]=(params[i].split("=")[1]);
        }

    }





